package com.yxjx.duoxue.datamodel;

import android.content.Context;

import com.yxjx.duoxue.utils.Utils;

public class DMOpenApp {
	
	private String version;// 版本信息
	private String device; // 设备信息
	private String mark; // 预留
	private int dbId; // 数据库index

	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getDevice() {
		return device;
	}
	public void setDevice(String device) {
		this.device = device;
	}
	
	/**
	 * 生成一个打开APP行为的记录
	 * @param context
	 * @return
	 */
	public static DMOpenApp getNewRecord(Context context) {
		DMOpenApp item = new DMOpenApp();
		item.setDevice(Utils.getFullDeviceId(context));
		item.setVersion(Utils.getAllVersionInfo(context));
		return item;
	}
	public int getDbId() {
		return dbId;
	}
	public void setDbId(int dbId) {
		this.dbId = dbId;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("\ndbId:" + getDbId());
		sb.append("\nversion:" + getVersion());
		sb.append("\ndevice:" + getDevice());
		return sb.toString();
	}
}
